package com.bosintek.wordtest.gui;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

import com.bosintek.wordtest.R;
import com.bosintek.wordtest.util.DataManager;
import com.bosintek.wordtest.util.ObjectsManager;

public class ConfigActivity extends Activity implements OnClickListener{
	EditText textUser;
	EditText textPass;
	Button btnUpdate;
	
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.configact);
        textUser = (EditText)findViewById(R.id.editUser);
        textPass = (EditText)findViewById(R.id.editPass);
        btnUpdate = (Button)findViewById(R.id.btnUpdate);
        btnUpdate.setOnClickListener(this);
        DataManager dm = new DataManager(ObjectsManager.getActivity());
        textUser.setText(dm.getUser());
        textPass.setText(dm.getPass());
    }

	@Override
	public void onClick(View v) {
		String user = this.textUser.getText().toString();
		String pass = this.textPass.getText().toString();
		DataManager dm = new DataManager(ObjectsManager.getActivity());
		dm.setUser(user);
		dm.setPass(pass);		
	}
    
}